FROM node:10-alpine3.10 as Dist
RUN mkdir /code
COPY . /code
WORKDIR /code
RUN npm config set registry https://registry.npm.taobao.org && npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass && npm install && npm run build

FROM nginx:1.23.3-alpine
COPY --from=Dist /code/dist/ /usr/share/nginx/html/
COPY --from=Dist /code/nginx/default.conf /etc/nginx/conf.d/default.conf
RUN echo 'build docker img ok!'

